package com.kylin.common.util;

import java.io.Writer;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.XMLConfiguration;

/**
 * 系统配置类
 * 加载配置文件信息，供系统所有程序调用
 * @author ly
 */public class Config {
	private static Configuration config;
	public static String homePath;
	
	/** 上传文件存放根路径 */
	public static String uploadFileDir;

	/** 允许上传的图片类型 */
	public static List allowImageTypes;	
	/** 允许上传的多媒体文件类型 */
	public static List allowMediaTypes;
	
	/**  上传文件最大尺寸 kb*/
	public static int uploadMaxSize;
	
	public static void load(String filePath) throws ConfigurationException {
		config = new XMLConfiguration(filePath);
	}

	public static void save(Writer arg0) throws ConfigurationException {
		// TODO Auto-generated method stub
		
	}

	public static void clear() {
		// TODO Auto-generated method stub
		 config .clear();
	}

	public static BigDecimal getBigDecimal(String arg0, BigDecimal arg1) {
		// TODO Auto-generated method stub
		return  config .getBigDecimal(arg0, arg1);
	}

	public static BigDecimal getBigDecimal(String arg0) {
		// TODO Auto-generated method stub
		return  config .getBigDecimal(arg0);
	}

	public static BigInteger getBigInteger(String arg0, BigInteger arg1) {
		// TODO Auto-generated method stub
		return  config .getBigInteger(arg0, arg1);
	}

	public static BigInteger getBigInteger(String arg0) {
		// TODO Auto-generated method stub
		return  config .getBigInteger(arg0);
	}

	public static boolean getBoolean(String arg0, boolean arg1) {
		// TODO Auto-generated method stub
		return  config .getBoolean(arg0, arg1);
	}

	public static Boolean getBoolean(String arg0, Boolean arg1) {
		// TODO Auto-generated method stub
		return  config .getBoolean(arg0, arg1);
	}

	public static boolean getBoolean(String arg0) {
		// TODO Auto-generated method stub
		return  config .getBoolean(arg0);
	}

	public static byte getByte(String arg0, byte arg1) {
		// TODO Auto-generated method stub
		return  config .getByte(arg0, arg1);
	}

	public static Byte getByte(String arg0, Byte arg1) {
		// TODO Auto-generated method stub
		return  config .getByte(arg0, arg1);
	}

	public static byte getByte(String arg0) {
		// TODO Auto-generated method stub
		return  config .getByte(arg0);
	}

	public static double getDouble(String arg0, double arg1) {
		// TODO Auto-generated method stub
		return  config .getDouble(arg0, arg1);
	}

	public static Double getDouble(String arg0, Double arg1) {
		// TODO Auto-generated method stub
		return  config .getDouble(arg0, arg1);
	}

	public static double getDouble(String arg0) {
		// TODO Auto-generated method stub
		return  config .getDouble(arg0);
	}

	public static float getFloat(String arg0, float arg1) {
		// TODO Auto-generated method stub
		return  config .getFloat(arg0, arg1);
	}

	public static Float getFloat(String arg0, Float arg1) {
		// TODO Auto-generated method stub
		return  config .getFloat(arg0, arg1);
	}

	public static float getFloat(String arg0) {
		// TODO Auto-generated method stub
		return  config .getFloat(arg0);
	}

	public static int getInt(String arg0, int arg1) {
		// TODO Auto-generated method stub
		return  config .getInt(arg0, arg1);
	}

	public static int getInt(String arg0) {
		// TODO Auto-generated method stub
		return  config .getInt(arg0);
	}

	public static Integer getInteger(String arg0, Integer arg1) {
		// TODO Auto-generated method stub
		return  config .getInteger(arg0, arg1);
	}


	public static Iterator getKeys(String arg0) {
		// TODO Auto-generated method stub
		return  config .getKeys(arg0);
	}

	public static List getList(String arg0, List arg1) {
		// TODO Auto-generated method stub
		return  config .getList(arg0, arg1);
	}

	public static List getList(String arg0) {
		// TODO Auto-generated method stub
		return  config .getList(arg0);
	}

	public static long getLong(String arg0, long arg1) {
		// TODO Auto-generated method stub
		return  config .getLong(arg0, arg1);
	}

	public static Long getLong(String arg0, Long arg1) {
		// TODO Auto-generated method stub
		return  config .getLong(arg0, arg1);
	}

	public static long getLong(String arg0) {
		// TODO Auto-generated method stub
		return  config .getLong(arg0);
	}


	public static Properties getProperties(String arg0) {
		// TODO Auto-generated method stub
		return  config .getProperties(arg0);
	}

	public static short getShort(String arg0, short arg1) {
		// TODO Auto-generated method stub
		return  config .getShort(arg0, arg1);
	}

	public static Short getShort(String arg0, Short arg1) {
		// TODO Auto-generated method stub
		return  config .getShort(arg0, arg1);
	}

	public static short getShort(String arg0) {
		// TODO Auto-generated method stub
		return  config .getShort(arg0);
	}

	public static String getString(String arg0, String arg1) {
		// TODO Auto-generated method stub
		return  config .getString(arg0, arg1);
	}

	public static String getString(String arg0) {
		// TODO Auto-generated method stub
		return  config .getString(arg0);
	}

	public static String[] getStringArray(String arg0) {
		// TODO Auto-generated method stub
		return  config .getStringArray(arg0);
	}

}
